<div class="navClassify">
	<div class="allClassift">
		<ul class="classiftUl">
			<li class="active"><span onclick="window.location.href='screeningResults.html'">全部分类</span>
				<ul class="classiftList" id="classiftBox">
					<script type="text/html" id="classiftItem">
					{{#  layui.each(d, function(index, item){ }}
						<li><span class="name" style="display: block;" data-categoryName ="{{item.categoryName}}">{{item.categoryName}}</span>
							{{# if(item.sonlassift.length>0){ }}
							<ul class="classiftListNext">
								{{#  layui.each(item.sonlassift, function(index, sonitem){ }}
								<li data-categoryName="{{sonitem.categoryName}}">{{sonitem.categoryName}}</li>
								{{# }); }}
							</ul>
							{{# } }}
						</li>
					{{# }); }}
					</script>
				</ul>
			</li>
		</ul>
	</div>
	<div class="ClassiftForm">
		<!--<input type="hidden" id="areaCode" />-->
		<input type="text" id="search"  name="search" class="ClassiftInput" placeholder="请输入材料名称"/>
		<button class="ClassiftBtn" style="cursor:pointer">搜索</button>
	</div>
</div>
<script>
layui.use(['Router','Zarea','Zutil',"navclassify"], function() {
	var Router = layui.Router;
	var Zarea = layui.Zarea;
	var Zutil = layui.Zutil;
	$(".ClassiftBtn").click(function(){
		var areaCode =$("select[name='areaCode']").val() || "";
		var search = $("input[name='search']").val().trim();
		search = window.btoa(Zutil.encodeURI(search));
		if(!search){
			$("#search").addClass("warn_anim");
			setTimeout(function(){
				$("#search").removeClass("warn_anim");
			},1200);
			return;
		}
		window.location.href='/ceca_two/modules/market/screeningResults.html?areaCode='+areaCode+'&search='+search
	});
	$("#search").keydown(function(event){
		var e = event || window.event || arguments.callee.caller.arguments[0];
		if(e && e.keyCode==13){ // enter 键
			var areaCode =$("select[name='areaCode']").val() || "";
			var search = $("input[name='search']").val();
			search = window.btoa(Zutil.encodeURI(search));
			window.location.href='/ceca_two/modules/market/screeningResults.html?areaCode='+areaCode+'&search='+search
		
        }
	});
});
</script>
